package models;

import java.util.*;
import models.mappers.*;
import voidlib.*;

/**
 *
 * @author nevidimov
 */
public class Credit extends VoidModel {
    protected VoidMapper mapper = new CreditMapper();
    
    @Override
    public VoidMapper getMapper() {
        return mapper;
    }
    
    @Override
    protected String _getModelId() {
        return "id";
    }    
    
    public int _amount;
    public int _businessmanId;
    public int _bankId;
    public long _created;
    public RequestStatus _status;
    public int _id = -1;
    
    public Credit() {
    }
    
    public Credit(int amount, int businessmanId, int bankId, RequestStatus status, long created) {
        this._amount = amount;
        this._businessmanId = businessmanId;
        this._bankId = bankId;
        this._status = status;
        this._created = created;
    }
    
    public int getAmount() {
        return _amount;
    }
    
    public int getBusinessmanId() {
        return _businessmanId;
    }
    
    public int getBankId() {
        return _bankId;
    }
    
    public RequestStatus getStatus() {
        return _status;
    }
    
    public int getId() {
        return _id;
    }
    
    public long getCreated() {
        return _created;
    }
    
    public User getBank() {
        User bank = new User().getMapper().fetch(getBankId());
        return bank;
    }
    
    public User getBusinessman() {
        User bman = new User().getMapper().fetch(getBusinessmanId());
        return bman;
    }


}


